-
-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add nix flake #332
add nix flake #332
Conversation
Firstly, I want to express my gratitude for opening the pull request and for your contributions.
This fusuma-plugin-appmatcher's error is due to appmatcher gnome-extension not being installed.
As I am not a nix user, I currently have no intentions to include nix-specific configurations in this or other repositories. It would be preferable if handling through an external repository such as the nix home-manager could be considered. As a side note:
|
Thank you once again for your understanding and for your valuable contributions. |
@iberianpig I respect the desire to keep package manager code outside of this repository. However, with regards to:
That is incorrect, as I already had the appmatcher extension installed and enabled. This unhandled exception was occurring despite the gnome extension being installed. I believe that there is some other dependency which is missing when using the nixpkgs version of fusuma, which I somehow inadvertently fixed in creating a new nix derivation. I'm not very fluent in Ruby, is there any more information surrounding this In the meantime, for any nix users looking to fix this problem, use |
Let me provide some background and explain using Ruby code. The error seems to be similar to what's discussed in Issue #3. The root cause appears to be the limitation imposed by Gnome 41 and later versions on the Eval of JavaScript through D-Bus. However, there might be a possibility that the Gnome extension is incorrectly detected as not installed by the following code: # @return [Class]
def backend_klass
case xdg_session_type
when /x11/
return X11
when /wayland/
case xdg_current_desktop
when /GNOME/
return GnomeExtension if GnomeExtensions::Installer.new.installed?
return Gnome
end
end
UnsupportedBackend
end The installation check is done in a straightforward manner by checking if a file exists at a specific path, as shown in the following code. It is possible that, for some reason, the file was not present at that location. # fusuma-plugin-appmatcher/lib/fusuma/plugin/appmatcher/gnome_extensions/installer.rb
EXTENSION = "./[email protected]"
def installed?
File.exist?(install_path)
end
def install_path(username = login_username)
File.expand_path("#{Dir.home(username)}/.local/share/gnome-shell/extensions/#{EXTENSION}")
end Specifically, it checks if a file exists at the following path, and if it does not find a file there, it determines that the extension is not installed: ~/.local/share/gnome-shell/extensions/[email protected] I hope this information helps in resolving the issue. If you have any further insights or ideas for improvement, I would appreciate your input. |
Thanks for the explanation, I understand the problem better now: the code in This does indeed imply that the difference between nixpkgs#fusuma and rcambrj/fusuma#fusuma is that the latter can somehow detect that the extension is installed. However, even when using the working version, nixos does not put the gnome extensions in this directory (it performs some other magic):
So I'm still not entirely sure what's making it work right now... I'll do some further investigation into this. In the meantime, might I suggest a more robust way of determining whether the extension is installed by using |
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea. I'm using this change anyway, feel free to discuss in this pull request!
Follow the instructions in CONTRIBUTING. Most importantly, ensure the tests and linter pass by running
bundle exec rspec
andbundle exec rubocop
. no ruby changes necessary so these tasks should still passUpdate code documentation if necessary. should I add a section to the readme for nixos?
related to: #323
In the above issue, @TroyMitchell911 reports:
This is the exact error that I was getting.
The
fusuma
package is already available in nixpkgs and I'm using it along with the home-manager service and the new gnome extension for which I made a pull request just moments ago.The nixpkgs fusuma package is outdated (3.5.0 vs 3.7.0), but I updated this package to the latest version in a nixpkgs fork and it still suffers from that same unhandled exception. I'm not yet sure what it is that I've fixed by recreating the derivation directly in this repository, but it works now.
As with the appmatcher gnome extension, you can see an example of how I've implemented this:
https://github.com/rcambrj/dotfiles/blob/b3108d9ae608e2e20eacb318c541b03aa470bd40/flake.nix#L43
https://github.com/rcambrj/dotfiles/blob/b3108d9ae608e2e20eacb318c541b03aa470bd40/hosts/mango/graphical/touchpad.nix
https://github.com/rcambrj/dotfiles/blob/b3108d9ae608e2e20eacb318c541b03aa470bd40/modules/home/rcambrj-graphical/touchpad.nix
If you're against putting nix-specific stuff into this repository, that's understandable, I figured that I would at least share my findings. It may be better to determine what's wrong with the nixpkgs derivation and fix that instead, but at the same time, there's nothing wrong with providing flake.nix in the source repository (its even encouraged where frequent updates are required).
New requirements:
bundle lock
bundix